using System;
using System.Collections;
using System.Xml;
using System.Configuration;
using System.Web.Configuration;

namespace Wrox {
  internal class PagePropertiesHandler : IConfigurationSectionHandler {
    public virtual object Create(Object parent, Object context, XmlNode node) {
      PagePropertiesConfig config = new PagePropertiesConfig((PagePropertiesConfig)parent);
      config.LoadValuesFromConfigurationXml(node);
      return config;
    }
  }

  public class PagePropertiesConfig {
    string	_backColor;

    internal PagePropertiesConfig(PagePropertiesConfig parent) {
      if (parent != null)
        _backColor = parent._backColor;
    }

    internal void LoadValuesFromConfigurationXml(XmlNode node) {
      Exception error = null;
      XmlAttributeCollection attributeCollection = node.Attributes;
      _backColor = attributeCollection["backColor"].Value;
    }

    public string BackColor{
     get {return _backColor;}
    }
  }
}